<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="shortcut icon" href="resources/img/logo.png">
<link rel="stylesheet" href="resources/plugin/layui/css/layui.css">
<link rel="stylesheet" href="resources/css/back.css">
<link rel="stylesheet"
	href="resources/plugin/font-awesome/css/font-awesome.min.css">
    <script src="resources/js/jquery-3.4.1.min.js"></script>
	
<script type="text/javascript">
$(function() {
	$("#submitId").click(function() {
		 $.ajax({
				type : "GET",
				url : "tag/updateSubmit",
				async : true,
				contentType : "application/json",
				data : {tagId : $("#updatetagId").val(),tagName:$("#updatetagName").val(),tagDescription:$("#updatetagDescription").val()},
				success : function(data) {
					if(data == "success"){
						parent.window.location.href="tag/tagPage";
					}
					
				}
			});
	
	});
	$("#closeId").click(function() {
		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
		parent.layer.close(index); //再执行关闭
	});
	
});
    </script>
    <script type="text/javascript">
    $(function() {
     var tag = parent.tag;
     $("#updatetagId").val(tag.tagId);
    $("#updatetagName").val(tag.tagName);
	$("#updatetagDescription").val(tag.tagDescription);	
	})
    </script>
</head>

<body>
<div class="layui-col-md4">
			<form class="layui-form" method="post" id="myForm"
				action="tag/updateSubmit">
				<div class="layui-form-item">
					<div class="layui-input-block">
						<strong>编辑标签</strong>
					</div>
					<div class="layui-input-block">
					    <input type="hidden" name="tagId" id="updatetagId">
						名称 <span style="color: #FF5722;">*</span> <input type="text" id="updatetagName" onblur="TgNamefun()"
							name="tagName" placeholder="请输入标签名称" autocomplete="off"
							class="layui-input" required><span id="sp"></span><br>
					</div>
					<br>
					<div class="layui-input-block">
						标签描述 <input type="text" name="tagDescription" id="updatetagDescription"
							placeholder="请输入标签描述" autocomplete="off" class="layui-input">
					</div>
					<br>
					<div class="layui-input-block">
						<button class="layui-btn" type="button" id="submitId">确认</button>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<button class="layui-btn" type="button" id="closeId">取消</button>
					</div>
				</div>
			</form>
			<blockquote class="layui-elem-quote layui-quote-nm">
				温馨提示：
				<ul>
					<li>1、标签名必选，建议不要太长</li>
					<li>2、标签名勿重复</li>
				</ul>
			</blockquote>
		</div>
</body>
</html>